<!DOCTYPE html>
<html>
  <head>
    {include file="common/meta" /}
  </head>
  
  <body class="form-wrap" >
    <div class="layui-fluid">
      <div class="layui-card">
        <div class="layui-card-header">修改商品分类</div>
        <div class="layui-card-body" style="padding: 15px;">
          <form class="layui-form" method="post" enctype="multipart/form-data">
            <!-- 分类的名称 -->
            <div class="layui-form-item">
              <label class="layui-form-label" style="width:130px;">分类的名称</label>
              <div class="layui-input-block layui-col-lg4" style="margin-left:0;">
                <input type="text" name="name" value="{$type.name}" placeholder="请输入分类名称" required class="layui-input" />
              </div>
            </div>

            <!-- 分类权重 -->
            <div class="layui-form-item">
              <label class="layui-form-label" style="width:130px;">分类权重</label>
              <div class="layui-input-block layui-col-lg4" style="margin-left:0;">
                <input type="number" value="{$type.weigh}" name="weigh" min="1" placeholder="分类权重的值" class="layui-input" />
              </div>
            </div>

            <!-- 分类图标 -->
            <div class="layui-form-item">
                <label class="layui-form-label" style="width:130px;">分类图标</label>
                <div class="avatar-add">  
                  <button onclick="cover.click()" type="button" class="layui-btn upload-img">
                    <i class="layui-icon">&#xe67c;</i>上传图标
                  </button>
  
                  <input type="file" name="cover" id="cover" hidden />

                  <a href="/{$type.cover}" target="_blank">
                    <img src="/{$type.cover}" style="width: 100px;height: 100px;" />
                  </a>
                </div>
              </div>
            
            <!-- 提交 -->
            <div class="layui-form-item">
              <div class="layui-input-block">
                <div class="layui-footer" style="left: 0;">
                  <button class="layui-btn" type="submit">提交</button>
                  <button type="button" class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
                </div>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </body>
</html>